<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="common :: header"/>
<body style="background-color: #fff">
    <style>
        .dm-form{padding-top: 20px; padding-left: 60px;}
        .dm-form tr{height: 50px;}
        .dm-form input{width: 260px}
        .dm-label{width: 80px;padding-right: 15px;text-align: right}
    </style>
    <form id="form_add" class="dm-form" method="post" action='/system/user/add'>
        <table>
            <tr>
                <td class="dm-label">帐号</td>
                <td class="dm-content">
                    <input class="easyui-textbox" name="loginName" data-options="required:true">
                </td>
            </tr>
            <tr>
                <td class="dm-label">姓名</td>
                <td class="dm-content">
                    <input class="easyui-textbox" name="userName" data-options="required:true">
                </td>
            </tr>
            <tr id="tr_icon">
                <td class="dm-label">手机</td>
                <td class="dm-content">
                    <input class="easyui-textbox" name="phone" validType="mobile" data-options="required:true">
                </td>
            </tr>
            <tr>
                <td class="dm-label">角色</td>
                <td class="dm-content">
                    <input id="user_roleIds" name="roleIds">
                </td>
            </tr>
            <tr>
                <td class="dm-label">部门</td>
                <td class="dm-content">
                    <input id="user_deptId" name="deptId">
                </td>
            </tr>
            <tr>
                <td class="dm-label">姓别</td>
                <td class="dm-content">
                    <input class="sex" name="sex" data-options="label:'男'" value="1" checked>
                    <input class="sex" name="sex" data-options="label:'女'" value="2">
                </td>
            </tr>
        </table>
    </form>
<script type="text/javascript">
    $(function() {
        $('.sex').radiobox({})

        $('#user_roleIds').combobox({
            url: '/system/role/getRoles',
            valueField: 'roleId',
            textField: 'roleName',
            multiple: true,
            required: true,
            editable: false
        });

        $('#user_deptId').combotree({
            url: '/system/dept/tree',
            cascadeCheck: false,
            editable: false,
            required: true,
            panelHeight: 240
        });
    });

    function submitHandler(index) {
        dm.save('form_add', function() {
            parent.layer.close(index);
            parent.dm.search('table', 'search_form');
        })
    }
</script>
</body>
</html>
